package com.outfood.api.controller;

import com.outfood.common.common.replay.ReplyCode;
import com.outfood.common.common.response.RestResponse;
import com.outfood.common.eleme.Result;
import com.outfood.service.impl.ElemeRemoteService;
import com.outfood.service.impl.WebDriverMapService;
import com.rys.framework.web.domain.server.Sys;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author huisonglin
 * @Description
 * @PackageName outfoodcat-master
 * @Package com.outfood.api.controller
 * @Date 2024-05-27 11:41
 * @Version 1.0
 */
@RestController
@Api(value = "ElemeOpertiaonController" ,tags = {"饿了么相关操作类"})
@RequestMapping("/api/eleme")
public class ElemeOpertiaonController {

    @Resource
    WebDriverMapService webDriverMapService;

    @Resource
    ElemeRemoteService elemeRemoteService;

    @ApiOperation("根据门店获取订单")
    @GetMapping("getOrder")
    public RestResponse getOrder(String shopId){
        List<Result> order = elemeRemoteService.getOrder(shopId);
        return RestResponse.success(order);
    }

    @ApiOperation("根据编号进行出餐")
    @GetMapping("toOut")
    public RestResponse out(String shopId ,String outtranNo){
        elemeRemoteService.out(shopId,outtranNo);
        return new RestResponse<>(ReplyCode.SYS.SUCCESS,"出餐成功");
    }
}
